Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 支持双栈访问 #2114

Open
wants to merge 1 commit into
base: frontier
Choose a base branch
from

Conversation

SakuraPuare
Copy link
Contributor

feat: set server_name to None to enable dual stack in web page

feat: #2064

实现双栈访问,ref to: encode/uvicorn#1529 (reply in thread)

已经测试以下 host

  • 0.0.0.0
  • 127.0.0.1
  • 192.168.38.197 (interface ip)
  • [::0]
  • [::1]
  • localhost (hosts to localhost and [::1])

需要被进一步讨论

hosts file

127.0.0.1               localhost
::1                     localhost

@binary-husky
Copy link
Owner

这个我不是很熟,我印象中 localhost 是不是就不能被局域网其他机器访问了

@SakuraPuare
Copy link
Contributor Author

要看uvicorn监听的接口,修改前的0.0.0.0,监听的是所有接口,其实是暴露在局域网上的,但只是ipv4 only。

修改后监听接口还是全部,但是有监听v6

@SakuraPuare
Copy link
Contributor Author

这个我不是很熟,我印象中 localhost 是不是就不能被局域网其他机器访问了

localhost 只是通过其中的一个host访问的 其实你用0.0.0.0 或者接口ip一样能访问,除非只监听127.0.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants